<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <common-head></common-head>
  </div>
  <template id="tpl">
    <div>
      <h2>这是公共头部</h2>
      {{ msg }}
    </div>
  </template>
  <script src="./vue.js"></script>
  <script>
    const CommonHead = {
      template: "#tpl",
      data(){
        return {
          msg: '组件内部数据'
        }
      }
    }
    Vue.component('CommonHead', CommonHead)
    const vm = new Vue({
      el: '#app'
    })
  </script>
</body>
</html>